package com.ruoyi.service.purchase;

import com.ruoyi.domain.purchase.MesPurchaseReceipt;
import java.util.List;

/**
 * 采购入库主表Service接口
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
public interface IMesPurchaseReceiptService {
    /**
     * 查询采购入库主表
     * 
     * @param receiptId 采购入库主表主键
     * @return 采购入库主表
     */
    public MesPurchaseReceipt selectMesPurchaseReceiptByReceiptId(Long receiptId);

    /**
     * 查询采购入库主表列表（排除已入库）
     * 
     * @param mesPurchaseReceipt 采购入库主表
     * @return 采购入库主表集合
     */
    public List<MesPurchaseReceipt> selectMesPurchaseReceiptList(MesPurchaseReceipt mesPurchaseReceipt);

    /**
     * 新增采购入库主表
     * 
     * @param mesPurchaseReceipt 采购入库主表
     * @return 结果
     */
    public int insertMesPurchaseReceipt(MesPurchaseReceipt mesPurchaseReceipt);

    /**
     * 修改采购入库主表
     * 
     * @param mesPurchaseReceipt 采购入库主表
     * @return 结果
     */
    public int updateMesPurchaseReceipt(MesPurchaseReceipt mesPurchaseReceipt);

    /**
     * 批量删除采购入库主表
     * 
     * @param receiptIds 需要删除的采购入库主表主键集合
     * @return 结果
     */
    public int deleteMesPurchaseReceiptByReceiptIds(Long[] receiptIds);

    /**
     * 删除采购入库主表信息
     * 
     * @param receiptId 采购入库主表主键
     * @return 结果
     */
    public int deleteMesPurchaseReceiptByReceiptId(Long receiptId);

    /**
     * 校验入库单号唯一性
     * 
     * @param receiptCode 入库单号
     * @return 结果
     */
    public String checkReceiptCodeUnique(String receiptCode);

    /**
     * 处理质检结果
     * 
     * @param receiptId        入库单ID
     * @param inspectionResult 质检结果（PASS通过 FAIL不通过）
     * @return 结果
     */
    public int handleInspectionResult(Long receiptId, String inspectionResult);

    /**
     * 执行采购入库
     * 
     * @param receiptId 入库单ID
     * @return 结果
     */
    public int executeMesPurchaseReceipt(Long receiptId);

    /**
     * 查询已入库的订单列表（用于历史记录）
     * 
     * @param mesPurchaseReceipt 采购入库主表
     * @return 采购入库主表集合
     */
    public List<MesPurchaseReceipt> selectReceivedReceiptList(MesPurchaseReceipt mesPurchaseReceipt);

    /**
     * 审核采购入库单
     * 
     * @param receiptId 入库单ID
     * @return 结果
     */
    public int approveMesPurchaseReceipt(Long receiptId);

    /**
     * 处理质检结果
     * 
     * @param receiptId        入库单ID
     * @param inspectionResult 质检结果（PASS通过 FAIL不通过）
     * @param remark           备注
     * @return 结果
     */
    public int handleInspectionResult(Long receiptId, String inspectionResult, String remark);

    /**
     * 根据供应商ID查询入库单列表
     * 
     * @param supplierId 供应商ID
     * @return 入库单列表
     */
    public List<MesPurchaseReceipt> selectReceiptListBySupplierId(Long supplierId);

    /**
     * 根据仓库ID查询入库单列表
     * 
     * @param warehouseId 仓库ID
     * @return 入库单列表
     */
    public List<MesPurchaseReceipt> selectReceiptListByWarehouseId(Long warehouseId);

    /**
     * 根据状态查询入库单列表
     * 
     * @param status 状态
     * @return 入库单列表
     */
    public List<MesPurchaseReceipt> selectReceiptListByStatus(String status);
}